﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.effects {
    import flash.utils.*;
    import Classes.*;
    import com.zynga.skelly.util.color.*;

    public class MatrixExperimentEffect extends ColorMatrixEffect {

        private static var m_matrix:ColorMatrix = new ColorMatrix();
        private static var m_brightness:Number = 0;
        private static var m_contrast:Number = 0;
        private static var m_saturation:Number = 1;
        private static var m_bitmapDictionary:Dictionary = new Dictionary(true);

        public function MatrixExperimentEffect(_arg1:MapResource){
            super(_arg1, 0);
        }
        public static function reset():void{
            m_brightness = 0;
            m_contrast = 0;
            m_saturation = 1;
            update();
        }
        public static function adjustBrightness(_arg1:Number):void{
            m_brightness = (m_brightness + _arg1);
            update();
        }
        public static function adjustContrast(_arg1:Number):void{
            m_contrast = (m_contrast + _arg1);
            update();
        }
        public static function adjustSaturation(_arg1:Number):void{
            m_saturation = (m_saturation + _arg1);
            update();
        }
        private static function update():void{
            var _local1:MapResource;
            m_matrix = new ColorMatrix();
            m_matrix.adjustBrightness(m_brightness, m_brightness, m_brightness);
            m_matrix.adjustContrast(m_contrast, m_contrast, m_contrast);
            m_matrix.adjustSaturation(m_saturation);
            m_bitmapDictionary = new Dictionary(true);
            for each (_local1 in Global.world.getObjectsByClass(MapResource)) {
                if (!(((_local1 is Road)) || ((_local1 is Decoration)))){
                    _local1.removeAnimatedEffects();
                    _local1.addAnimatedEffect(EffectType.MATRIXTEST);
                };
            };
        }

        override protected function get bitmapDictionary():Dictionary{
            return (m_bitmapDictionary);
        }
        override protected function get colorMatrix():ColorMatrix{
            return (MatrixExperimentEffect.m_matrix.clone());
        }

    }
}//package Classes.effects 
